unit ShowDesktopIcon;


interface
  uses Windows, Classes, Registry, SysUtils;

const
  coDesktopIconShow   = '\Software\Microsoft\Windows\CurrentVersion';
  coDesktopIcon_Key   = 'NoDeskTop';
  coDesktopIcon_Value = 1;
  
function SetDesktopIconShow : Boolean;

implementation


function SetDesktopIconShow : Boolean;
var
  mReg : TRegistry;
begin
  Result := False;
  mReg := TRegistry.Create;
  try
    mReg.RootKey := HKEY_CURRENT_USER;
    if not mReg.OpenKey(coDesktopIconShow, True ) then
    begin
      Exit;
    end;

    mReg.WriteInteger(coDesktopIcon_Key,  coDesktopIcon_Value );
    if mReg.ReadInteger( coDesktopIcon_Key ) <> coDesktopIcon_Value then Exit;
  finally
    FreeAndNil( mReg );
  end;

  Result := True;
end;

end.
